<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./template/FormatoPlaneacionTemplate.xhtml">

            <ui:define name="top">
             LISTA DOCENTE
            </ui:define>

            <ui:define name="content">
                <f:view>

                    <h:form>
                                              
                        <p:commandButton value="Crear" action="#{docenteBean.prepararNuevo}" />
                        <p:commandButton value="Pdf" ajax="false" >
                            <p:dataExporter type="pdf" target="tbl" fileName="docentes"  />
                        </p:commandButton>
                         <p:commandButton value="Excel" ajax="false">
                             <p:dataExporter type="xls" target="tbl" fileName="docentes" />
                        </p:commandButton>
                        
                        <p:dataTable id="tbl" value="#{docenteBean.docentes()}" var="item">
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Id"/>
                                </f:facet>
                                <h:outputText value="#{item.id}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Nombre"/>
                                </f:facet>
                                <h:outputText value="#{item.nombre}"/>
                            </p:column>
                            <p:column exportable="false">
                                <p:commandButton value="E" action="DocenteCrearEditar" actionListener="#{docenteBean.prepararEditar}" ajax="false" />
                            </p:column>
                            <p:column exportable="false"> 
                                <p:commandButton value="R" action="DocenteConfirmar" actionListener="#{docenteBean.prepararRemover}" ajax="false"/>
                            </p:column>
                        </p:dataTable>
                    </h:form>
                </f:view>

            </ui:define>

        </ui:composition>

    </body>
</html>
